﻿using System;

namespace DesignModeConsole.设计原则.LiskovSubstitutionPrinciple
{
    public abstract class Employee1
    {
        public string Name { get; set; }

        /// <summary>
        /// 计算奖金
        /// </summary>
        /// <returns></returns>
        public abstract decimal CalculateBonus();
    }

    /// <summary>
    /// 永久雇员
    /// </summary>
    public class PermanentEmployee1 : Employee1
    {
        public override decimal CalculateBonus()
        {
            return 80000;
        }
    }

    /// <summary>
    /// 合同工
    /// </summary>
    public class ContractEmployee1 : Employee1
    {
        public override decimal CalculateBonus()
        {
            return 2000;
        }
    }

    /// <summary>
    /// 临时工（临时工没有奖金）
    /// </summary>
    public class TemporaryEmployee1 : Employee1
    {
        public override decimal CalculateBonus()
        {
            throw new NotImplementedException(); //违反里氏替换原则，因为当使用该类去替换附父类的时候，会报错
        }
    }
}